home *** CD-ROM | disk | FTP | other *** search
/ Amiga Game-Power / Amiga Game-Power.iso / anwendungen / gw print / structurebrowser_v1.3 / sources / sbview.c < prev    next >
C/C++ Source or Header  |  1994-05-20  |  4KB  |  143 lines

  1. /*
  2.    Handles: ColorMap, View and ViewPort
  3.  
  4.    Not implemented:
  5.       ColorMap.Flags
  6.       ColorMap.Type
  7.       ViewPort.DspIns
  8.       ViewPort.SprIns
  9.       ViewPort.ClrIns
  10.       ViewPort.UCopIns
  11.       ViewPort.RasInfo
  12.       View.LOFCprList
  13.       View.SHFCprList
  14.       View.Modes
  15. */
  16.  
  17. #include "header/sb.h"
  18.  
  19. extern int level;
  20.  
  21.  
  22. PrColorMap (string, colormap)
  23. char *string;
  24. struct ColorMap *colormap;
  25. {
  26. static struct StructData structdata[] = {
  27.    { "(Flags",        "UBYTE)", PRUBYTE, BYTESIZE   },
  28.    { "(Type",         "UBYTE)", PRUBYTE, BYTESIZE   },
  29.    { "-Count",        "UWORD",  PRUINT,  INTSIZE    },
  30.    { " ColorTable",   "APTR",   PRPTR,   PTRSIZE    }
  31. };
  32.  
  33. int i, sum;
  34. int choice = -1;
  35.  
  36.    level++;
  37.  
  38.    while (choice)
  39.    {
  40.       sum = SetOptionText(string, structdata, (APTR)colormap, DATASIZE, 0);
  41.  
  42.       switch (choice = GetChoice(DATASIZE))
  43.       {
  44.          case 4:
  45.             HexDump("Hexdump of Color Table:",
  46.                     colormap->ColorTable, INTSIZE,
  47.                     (long)colormap->Count * INTSIZE);
  48.             break;
  49.       }
  50.    }
  51.    level--;
  52. }
  53.  
  54.  
  55. PrViewPort (string, viewport)
  56. char *string;
  57. struct ViewPort *viewport;
  58. {
  59. static struct StructData structdata[] = {
  60.    { " Next",         "struct ViewPort *",    PRPTR,  PTRSIZE    },
  61.    { " ColorMap",     "struct ColorMap *",    PRPTR,  PTRSIZE    },
  62.    { "(DspIns",       "struct CopList *)",    PRPTR,  PTRSIZE    },
  63.    { "(SprIns",       "struct CopList *)",    PRPTR,  PTRSIZE    },
  64.    { "(ClrIns",       "struct CopList *)",    PRPTR,  PTRSIZE    },
  65.    { "(UCopIns",      "struct UCopList *)",   PRPTR,  PTRSIZE    },
  66.    { "-DWidth",       "SHORT",                PRINT,  INTSIZE    },
  67.    { "-DHeight",      "SHORT",                PRINT,  INTSIZE    },
  68.    { "-DxOffset",     "SHORT",                PRINT,  INTSIZE    },
  69.    { "-DyOffset",     "SHORT",                PRINT,  INTSIZE    },
  70.    { " Modes",        "UWORD",                PRUINT, INTSIZE    },
  71.    { "-Reserved",     "UWORD",                PRUINT, INTSIZE    },
  72.    { "(RasInfo",      "struct RasInfo *)",    PRPTR,  PTRSIZE    }
  73. };
  74.  
  75. static char *modenames[16] = {
  76.    NULL,             "GENLOCK_VIDEO", "LACE",      NULL,
  77.    NULL,             NULL,            "PFBA",      "EXTRA_HALFBRITE",
  78.    "GENLOCK_AUDIO",  NULL,            "DUALPF",    "HAM",
  79.    NULL,             "VP_HIDE",       "SPRITES",   "HIRES"
  80. };
  81.  
  82. int i, sum;
  83. int choice = -1;
  84.  
  85.    level++;
  86.  
  87.    while (choice)
  88.    {
  89.       sum = SetOptionText(string, structdata, (APTR)viewport, DATASIZE, 0);
  90.  
  91.       switch (choice = GetChoice(DATASIZE))
  92.       {
  93.          case 1:
  94.             if (viewport->Next)
  95.                PrViewPort("The next ViewPort in the list", viewport->Next);
  96.             break;
  97.          case 2:
  98.             if (viewport->ColorMap)
  99.                PrColorMap("The ViewPort's ColorMap", viewport->ColorMap);
  100.             break;
  101.          case 11:
  102.             FlagPrint("Modes for this ViewPort",
  103.                   modenames, (ULONG)viewport->Modes);
  104.             break;
  105.       }
  106.    }
  107.    level--;
  108. }
  109.  
  110.  
  111. PrView (string, view)
  112. char *string;
  113. struct View *view;
  114. {
  115. static struct StructData structdata [] = {
  116.    { " ViewPort",     "struct ViewPort *",    PRPTR,  PTRSIZE },
  117.    { "(LOFCprList",   "struct cprlist *)",    PRPTR,  PTRSIZE },
  118.    { "(SHFCprList",   "struct cprlist *)",    PRPTR,  PTRSIZE },
  119.    { "-DyOffset",     "short",                PRINT,  INTSIZE },
  120.    { "-DxOffset",     "short",                PRINT,  INTSIZE },
  121.    { "(Modes",        "UWORD)",               PRUINT, INTSIZE }
  122. };
  123.  
  124. int i, sum;
  125. int choice = -1;
  126.  
  127.    level++;
  128.  
  129.    while (choice)
  130.    {
  131.       sum = SetOptionText(string, structdata, (APTR)view, DATASIZE, 0);
  132.  
  133.       switch (choice = GetChoice(DATASIZE))
  134.       {
  135.          case 1:
  136.             if (view->ViewPort)
  137.                PrViewPort("The View's first ViewPort", view->ViewPort);
  138.             break;
  139.       }
  140.    }
  141.    level--;
  142. }
  143.